c# detect if string has a nubmer and store it

48

c# detect if string has a nubmer and store it -

string input = Console.ReadLine();
int parsedId;
int.TryParse(input, out parsedId)
//i tried it on string that are more than just numbers it can detect but cant store
//example input=65,parsedId=65    input=65acd,parseid=0 ??
//i say youre better of learning regex or linq (i know it sucks)
//upvote so my whore ex wife gives me back the kids

Comments

Submit
0 Comments